/obj/effect/blob/factory
	name = "porous blob"
	icon = 'icons/mob/blob.dmi'
	icon_state = "blob_factory"
	health = 100
	brute_resist = 1
	fire_resist = 2
	var/list/spores = list()
	var/max_spores = 3
	var/spore_delay = 0

	update_icon()
		if(health <= 0)
			playsound(src.loc, 'sound/effects/splat.ogg', 50, 1)
			Delete()
			return
		return


	run_action()
		if(spores.len >= max_spores)
			return 0
		if(spore_delay > world.time)
			return 0
		spore_delay = world.time + 100 // 10 seconds
		new/mob/living/simple_animal/hostile/blobspore(src.loc, src)
		return 1


/mob/living/simple_animal/hostile/blobspore
	name = "blob"
	desc = "Some blob thing."
	icon = 'icons/mob/blob.dmi'
	icon_state = "blobpod"
	icon_living = "blobpod"
	pass_flags = PASSBLOB
	health = 15
	maxHealth = 15
	melee_damage_lower = 2
	melee_damage_upper = 4
	attacktext = "hits"
	attack_sound = 'sound/weapons/genhit1.ogg'
	var/obj/effect/blob/factory/factory = null
	faction = "blob"

	New(loc, var/obj/effect/blob/factory/linked_node)
		if(istype(linked_node))
			factory = linked_node
			factory.spores += src
		..()

	Die()
		if(factory)
			factory.spores -= src
		..()